import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

@Configuration
@EnableAspectJAutoProxy // 启用AOP自动代理
public class ApplicationContext {

    // 注册订单服务实例
    @Bean
    public OrderService orderService() {
        return new OrderServiceImpl();
    }

    // 注册切面实例
    @Bean
    public OrderAspect orderAspect() {
        return new OrderAspect();
    }
}
    